﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>个人日志</title>
<style type="text/css">
body {
	margin:0;
}
.list_content {
	background-color: #fff;
	color:#73938E;
	font-size:12px;
	line-height:15px;
	text-align:center;
}
.list_top_title {
	font-size:12px;
	background-color: #F3F8F7;
	color:#73938E;
	font-weight:bold;
	line-height:30px;
	text-align:center;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}
table.calendar {
	border: 1px solid #050;
}
.calendar th, .calendar td {
	width:30px;
	text-align:center;
}            
.calendar th {
	background-color:#F3F8F7;
	color:#73938E;
}
.today{
color:#73938E;
background-color:#F3F8F7;                
}
</style>
</head>
<script src="../js/Calendar.js" language="javascript"></script>
<script language="javascript">
function delcfm(){
    if(!confirm("确认要删除日志信息吗？")){
        window.event.returnValue = false;
    }
}
</script>
<body>
<?php
  session_start();
 include("../main/function.php");
 include("../main/ShowPage.class.php");
 include("../main/islogin.php");
 $db=new Db();
// $teacher_id=$_GET['action'];
 $body=$_POST['txtMessage'];
 if( $body)
 {
 date_default_timezone_set('PRC');
//echo date('Y-m-d H:i:s');
	 $nowtime=date('Y-m-d');
	//echo $nowtime= time();
  $db->query("INSERT INTO `tms`.`log` (`id`, `teacherID`, `time`, `body`) VALUES (NULL, '1', '$nowtime', '$body')");
 }

 $sql="select * from log   ";
 $logs=$db->fetchRows($sql);
 $logsNO=$db->rowNum($sql);



//显示日历
$params = array();
if (isset($_GET['year']) && isset($_GET['month']))
{
    $params = array(
        'year' => $_GET['year'],
        'month' => $_GET['month'],
    );
}
$params['url']  = 'log.php';
require_once 'calendar.class.php';
?>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  <TR height=28 >
    <TD background=../images/title_bg1.jpg>-->当前位置:个人日志</TD>
</TR>
<tr>
<td>&nbsp;</td>
</tr>
</TABLE>
  <form name="form1" method="post" action="#" id="form1">
<table width="810px" border="1" align="center"  cellpadding="3" cellspacing="0"  bordercolor="#F3F8F7"  >
<tr  height="100px">
<td width="560" valign="top" >
 <textarea name="txtMessage" id="txtMessage" type="text" style="  height:120px; width:85%; margin-top:10px; margin-left:0px; "></textarea>
    <table cellpadding="0" cellspacing="0" height="29" width="100%" >
       <tr>
          <td width="30%" valign="middle">   </td>
         <td width="53%" valign="middle" align="right"><input type="submit" name="Submit" id="Submit" value="提交" /></td>
         <td width="17%" valign="middle" align="center">  </td>
       </tr>
    </table>
</td>
<!--<td >
	<div style="align:center">
		<?php /*
			$cal = new Calendar($params);
			$cal->display();*/
		?>  
	</div>
</td>-->
</tr>
</table>
  </form>

  <table width="810px"  align="center" >
  <?php for($n=0;$n<$logsNO;$n++ )	{ ?> 
  <tr>
 <td>
 <label>
 <textarea name="textarea" cols="80" rows="5" readonly="readonly"><?php echo $logs[$n][body];?></textarea>
 </label> </td>
 </tr>
 <tr>
 <td width="300">发布时间：<?php echo $logs[$n][time]; ?></td>
 <td><!--<input name="del" type="button" id="del" value="删除"  onclick="delcfm()"  src="delete_log.php?id=<?php $logs[$n][id]?>" />-->
 <a href="delete_log.php?id=<?php echo $logs[$n][id];?>" onclick="delcfm()">删除</a></td>
  </tr>
 <?php } ?>

 </table>

</body>
</html>
